<template>
    <h1>{{ state.name }}</h1>
    <p>{{ state.title }}</p>


    <button @click="add">点击增加</button>
    <h1>number:{{ number }}</h1>
    <h1>count:{{ state.count }}</h1>
</template>

<script>
import {ref} from "vue"
import {useStore} from "vuex"



export default {
    name: 'Counter',
    props: {

    },
    setup() {
        const store = useStore();
        const state = ref(store.state)
        const number = ref(0)
        const add = function() {
            number.value ++ 
            // state.count.value = state.count.value + 1
        }
        return{
            number,
            add,
            state
        }
    }
}
</script>


<style>

</style>
